<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>
    <link rel="stylesheet" th:href="@{css/bootstrap.min.css}"/>
    <link rel="stylesheet" th:href="@{css/bootstrap-theme.min.css}"/>
    <script type="text/javascript" th:src="@{js/jquery.min.js}"></script>
</head>
<body>
<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">第一个基于Thymeleaf模板引擎的Spring Boot Web应用</h3>
    </div>
</div>
<div class="container">
    <form method="post" th:action="@{/submit}" th:object="${user}">
        <table>
            <tr>
                <td>用户名：</td>
                <td><input type="text" th:field="${user.name}"/></td>
            </tr>
            <tr>
                <td>性别：</td>
                <td><select th:field="*{sex}">
                    <option th:each="sex : ${sexes}" th:value="${sex.value}" th:text="${sex.key}"></option>
                </select>
                </td>
            </tr>
            <tr>
                <td>喜欢的颜色：</td>
                <td>
                   <span th:each="color : ${colors}">
                       <input type="checkbox" th:field="*{myColors}" th:value="${color}"/>
                       <label th:for="${#ids.prev('myColors')}" th:text="${color}"></label>
                   </span>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="submit" value="提交"/>
                </td>
            </tr>
        </table>

    </form>
</div>
</body>
</html>
